package cn.com.dodo.demo.datasource.controller;

import cn.com.dodo.demo.datasource.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class StudentController {

    @Autowired
    private StudentService studentService;

    @RequestMapping("querystudentsfromsqlite")
    public List<Map<String, Object>> queryStudentsFromOracle() {
        return this.studentService.getAllStudentsFromSqlite();
    }

    @RequestMapping("querystudentsfromh2")
    public List<Map<String, Object>> queryStudentsFromH2() {
        return this.studentService.getAllStudentsFromH2();
    }

    @RequestMapping("querystudentsfromhsqldb")
    public List<Map<String, Object>> queryStudentsFromHsqldb() {
        return this.studentService.getAllStudentsFromHsqldb();
    }
}
